package com.cskaoyan.wx.controller;

import com.cskaoyan.vo.BaseRespVo;
import com.cskaoyan.wx.bean.bo.WxCollectAddBo;
import com.cskaoyan.wx.bean.vo.CollectListVo;
import com.cskaoyan.wx.bean.vo.WxAddOrDeleteVo;
import com.cskaoyan.wx.service.WxCollectService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @ description:
 * @ author:台
 **/

@RestController
public class WxCollectController {

    @Autowired
    WxCollectService wxCollectService;

    @RequestMapping("wx/collect/addordelete")
    public BaseRespVo collectAddOrDelete(@RequestBody WxCollectAddBo wxCollectAddBo){
        Byte type = wxCollectAddBo.getType();
        Integer valueId = wxCollectAddBo.getValueId();
        WxAddOrDeleteVo wxAddOrDeleteVo = wxCollectService.addOrDelete(type,valueId);
        return BaseRespVo.ok(wxAddOrDeleteVo);
    }

    @RequestMapping("wx/collect/list")
    public BaseRespVo collectList(Byte type,Integer page,Integer size){
        CollectListVo collectListVo = wxCollectService.collectList(type,page,size);
        return BaseRespVo.ok(collectListVo);
    }
}
